<template>

     <div class="rule">
                <div>
                    <van-nav-bar :title="data.cate_name" left-arrow @click-left="$router.go(-1)" />
                </div>
               
                <div class="header_placeholder" style="width:100%;height:4rem" id="cust_head"></div>
                <div class="rule_main">
                    <div class="rule_info">
                        <h4>{{data.title}}</h4>
                        <p v-html="data.content"></p>
                    </div>
                   
                </div>
            </div>


</template>

<script>

export default {
 name: "login",
data() {
    return {
        active:2,
        data:{},
    }
},
mounted() { 
    this.base.head_status(1)
    this.GetRang_metd()
},

 methods: {
     GetRang_metd(){

         
             let that=this;


             if(that.$route.params.id=="gonggao"){

                      var data={token:JSON.parse(localStorage.userinfo).token,id:7}
                    that._API.gonggao(data).then(res => {
                            if(res.code==200){
                                 
                                    for(let i=0;i< res.data.length;i++){
                                        console.log(that.$route.params.uid)
                                        if(i==that.$route.params.uid){
                                                that.data=res.data[i]
                                        }
                                    }
                                    

                            }

                        }).catch(err => {
                            console.log("err", err);
                        });
                return
            }
        
             var data={token:JSON.parse(localStorage.userinfo).token,id:that.$route.params.id}
                       that._API.article(data).then(res => {
                            if(res.code==200){
                                that.data=res.data;
                             
                                 
                            }else{
                                 that.$toast({ message: res.msg, position: "bottom" });
                            }
                           
                        }).catch(err => {
                            console.log("err", err);
                        });
     },
               
       
              onClickLeft(){
               
           }
               


      }
}
</script>

<style lang="scss" scoped >
 .van-nav-bar{
        background: none;
        width:100%;
        position: fixed;
    }
    .van-nav-bar .van-icon{
        color:#fff;
    }
    .van-nav-bar__arrow{
        font-size:20px;
    }
    .van-nav-bar__title{
        color:#fff;
    }

    .rule_main{
        padding:0 0.8rem;
        width:100%;
        box-sizing: border-box;
    }
    .rule_info h4{
        font-size:0.9rem;
        color: #00C6FF;
        font-weight: 400;
        margin:1rem 0 0.4rem;
    }
    .rule_info p{
        font-size:0.82rem;
        line-height: 1.4rem;
        text-indent: 2em;
        color: rgba(255,255,255,0.8);
    }
</style>
